package com.ys.base;

import com.ys.utils.base.j2se.DateHandler;
import com.ys.utils.base.j2se.DateUtil;
import com.ys.utils.base.j2se.StringHandler;

import java.util.Date;

/**
 * Description
 * Created by 王伟
 * Date create on 18:38 2019/12/19.
 */
public class BaseParam {
    /* 获取订单号 */
    public static String getOrderSN(){
        return String.format("%s%s%s", DateUtil.getYYMMDD(),System.currentTimeMillis()%1000000000,(int)(Math.random()*899999+100000));
    }

    public static String busNo(String head) {
        if(StringHandler.isNotEmpty(head)) {
            head = head.toUpperCase();
        }
        Date now = new Date();
        return head + DateHandler.getDate(now, "yyyyMMddHHmmss") + "" + (int)(Math.random()*899999+100000);
    }
}
